﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<VCC.CMS.ViewModels.BoxNewAdsViewModel>" %>
<%@ Import Namespace="VCC.Lib.Common" %>
<%@ Import Namespace="VCC.Lib.Helpers" %>
<%  
    foreach (var item in Model.Ads)
    {%>
<%var LinkTodetails = Html.AdDetailRoute(item); %>
<div class="box_xinh">
    <div class="img_box_xinh">
        <img width="98" height="95" src="<%=LinkUtils.UrlImageOrDefault(item.Image)%>">
        <div class="vipchua">
            <img width="40" height="40" src="/images/vipbox.gif"></div>
    </div>
    <div class="text_box_xinh">
        <div class="ss">
            <a href="<%=LinkTodetails%>" title=""><%= Html.Encode(item.Title.Length > 150 ? item.Title.Substring(0, 150) + "..." : item.Title)%></a>
        </div><br />
        <span class="hightlight"><%=Utils.DateTimeToStringFormat(item.ModifyDate.Value)%></span>... Lượt xem: <span class="hightlight" style="color: #EC1C24"><%= string.IsNullOrEmpty(item.ViewNumber.ToString()) ? 0 : item.ViewNumber %></span>...
        Liên hệ: <span class="hightlight"><%=Html.Encode(item.MobileContact)%></span>
        <br>
        <span class="ss3">Giá: <%= Html.Encode(string.IsNullOrEmpty(item.Cost) ? "xem thông tin chi tiết" : string.Format("{0:#,#}",item.Cost) +".."+ item.CostType.Name)%></span>
        <span class="ss1">Tại: <span class="hightlight"><%= Html.Encode(item.DistrictID != null ? item.City.Districts.FirstOrDefault(e => e.ID == item.DistrictID).Name + " - " + item.City.Name : item.City.Name)%></span></span>
    </div>
</div>
<% }%>
